﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvDTE;
using EnvDTE80;

namespace BovespaDesignRules
{
    public sealed class Rule_AvoidPrivateProperty : BaseAddIn.Rules.BaseRuleAddIn
    {
        #region Constructor

        public Rule_AvoidPrivateProperty()
            : base("BovespaAvoidPrivateProperty", "BovespaDesignRules.BovespaDesignRules", typeof(Rule_AvoidPrivateProperty).Assembly)
        {
        }

        #endregion

        #region Protected Override Methods

        protected sealed override void Check(CodeProperty propriedade, CodeNamespace namespaceElement, CodeClass2 classe)
        {
            if (propriedade.Access != vsCMAccess.vsCMAccessPublic)
            {
                GeraProblemaAddIn(propriedade.StartPoint.Parent.Parent.FullName,
                                 propriedade.StartPoint.Line,
                                 propriedade.StartPoint.DisplayColumn,
                                 "AvoidPrivatePropertyResolution",
                                 classe.Name,
                                 propriedade.Name,
                                 namespaceElement.Name);
            }
        }

        #endregion
    }
}
